#include <unistd.h>

int* alloc_mem()
{
    int* p = new int;
    return p;
}

int main(int argc, char* argv[])
{
    int* p { nullptr };
    for (;;) {
        p = alloc_mem();
        *p = 0;
        sleep(1);
    }
    return *p;
}
